/*
 * $Id$
 */
package py.firefly.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author myang
 */
public class Log {
    
    private Logger _log;

    public static Log of(final String name) {
        return new Log(name);
    }

    private Log(final String name) {
        _log = LoggerFactory.getLogger(name);
    }

    public void debug(final String s) {
        if (_log.isDebugEnabled()) _log.debug(s);
    }

    public void debug(final String fmt, final Object... args) {
        if (_log.isDebugEnabled()) _log.debug(fmt, args);
    }

    public void info(final String s) {
        if (_log.isInfoEnabled()) _log.info(s);
    }

    public void info(final String fmt, final Object... args) {
        if (_log.isInfoEnabled()) _log.info(fmt, args);
    }

    public void info(final Object o) {
        if (_log.isInfoEnabled()) _log.info(null == o ? "null" : o.toString());
    }

}
